home *** CD-ROM | disk | FTP | other *** search
/ Aminet 3 / Aminet 3 - July 1994.iso / Aminet / disk / misc / Mtools207.lha / Mtools-2.0.7 / src / amiga_devices.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-05-27  |  2.1 KB  |  73 lines

  1. /* -------------------------------------------------- 
  2.  |  NAME
  3.  |    devices
  4.  |  PURPOSE
  5.  |    provide simple routines and access to an exec device.
  6.  |  NOTES
  7.  | 
  8.  |  COPYRIGHT
  9.  |    Copyright (C) 1993  Christian E. Hopps
  10.  |
  11.  |    This program is free software; you can redistribute it and/or modify
  12.  |    it under the terms of the GNU General Public License as published by
  13.  |    the Free Software Foundation; either version 2 of the License, or
  14.  |    (at your option) any later version.
  15.  |
  16.  |    This program is distributed in the hope that it will be useful,
  17.  |    but WITHOUT ANY WARRANTY; without even the implied warranty of
  18.  |    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  19.  |    GNU General Public License for more details.
  20.  |
  21.  |    You should have received a copy of the GNU General Public License
  22.  |    along with this program; if not, write to the Free Software
  23.  |    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  24.  |    
  25.  |  HISTORY
  26.  |    chopps - Oct 9, 1993: Created.
  27.  +--------------------------------------------------- */
  28.  
  29. #if ! defined (_DEVICES_H)
  30. #define _DEVICES_H
  31.  
  32. /* #include "util.h" */
  33.  
  34. #include <exec/types.h>
  35. #include <exec/memory.h>
  36. #include <exec/nodes.h>
  37. #include <exec/lists.h>
  38. #include <dos/dos.h>
  39. #include <dos/dosextens.h>
  40.  
  41. #include <clib/exec_protos.h>
  42. #include <stdarg.h>
  43. #include <stddef.h>
  44. #include <stdio.h>
  45.  
  46. #include <exec/ports.h>
  47. #include <exec/io.h>
  48. #include <exec/devices.h>
  49.  
  50. typedef ULONG ulong;
  51.  
  52. #define copy_string(x) alloc_string (x)
  53.  
  54. struct device_data {
  55.     struct MsgPort *port;
  56.     struct IORequest *io;
  57.     char  *name;
  58.     ulong  unit;
  59.     ulong  flags;
  60.     int    open;
  61.     
  62. };
  63.  
  64. struct device_data * alloc_device  (char *name, ulong unit, ulong flags, ulong iosize);
  65. void free_device  (struct device_data *dd);
  66. int open_device  (struct device_data *dd);
  67. void close_device  (struct device_data *dd);
  68. ulong device_read  (struct device_data *dd, ulong offset, ulong bytes, void *buffer);
  69. ulong device_write  (struct device_data *dd, ulong offset, ulong bytes, void *buffer);
  70. int device_do_command  (struct device_data *dd, UWORD command);
  71.  
  72. #endif /* _DEVICES_H */
  73.